﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CalcClassLibrary.Interface;

namespace CalcClassLibrary.Model
{
    /// <summary>
    /// TODO: Update summary.
    /// </summary>
    public class BasicCalculator : IBasicCalculator
    {
        public int Add(int a, int b)
        {
            return a + b;
        }

        public int Mul(int a, int b)
        {
            return a * b;
        }

        public int Div(int a, int b)
        {
            int retval;

            try
            {
                retval = a / b;
            }
            catch (Exception ex)
            {
                retval = 0;
            }

            return retval;
        }

        public int Sub(int a, int b)
        {
            return a - b;
        }
    }
}